package cn.itlb.spring.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.itlb.spring.model.UserModel;
@Repository
public class UserDaoImpl extends BaseDao implements UserDao{

	@Override
	public void add(UserModel user) {
		String sql="insert into user(id,name) values(?,?)";
		super.getJdbcTemplate().update(sql, user.getId(),user.getName());		
	}

	@Override
	public List<UserModel> findall() {
		String sql="select * from user";
		return super.getJdbcTemplate().queryForList(sql, UserModel.class);
	}

}
